package com.v5ba.factoryBeanDemo;

import org.springframework.beans.factory.FactoryBean;
import org.springframework.stereotype.Component;

/**
 * @author yiren
 * @since 2022/9/20
 */
@Component("userServiceFactory")
public class UserServiceFactory implements FactoryBean<UserService> {
    @Override
    public UserService getObject() throws Exception {
        return new UserService();
    }
    @Override
    public Class<?> getObjectType() {
        return UserService.class;
    }

    public void test(){
        System.out.println("我是UserServiceFactory");
    }
}
